Repository navigation
Freeze released bundle, control-plan and apply-crash workflows (#271) - #290
Merged
Merged
Conversation
The Workflows family of the persisted-contracts D rows, part 2b: the three cases part 2a left as "not yet" because they need new release-written bytes. freeze.py --part 2b adds scenarios to an existing release directory without writing anything already there (each new scenario directory and bindings-2b.json must not exist), from a fresh box of its own. For both v0.2.0 and v0.3.0: - bundle-saved: the worker exits right after the final node's bundle is saved, before the manifest records the node's outcome; then bundle-saved-recovered, after the release's own status. The fake kimi reports token usage here (opt-in), so the bundle carries some. - control-planned, control-completed: Toolgraph control plans on, with a fake toolgraph that answers both protocols from the request it gets. - apply-unreceipted, apply-receipted: a completed workflow's final artifact applied in the release interpreter, dying right after the applying record or right before the applied one (the artifacts family's crash script). The test reads each scenario with its own bindings document and rebinds the apply receipt's repository root (once; it holds no fingerprint). - resume reclaims the released bundle: no provider call, calls_used unchanged, the bundle's usage added once, and the final artifact's patch is the released bundle's; a bundle whose patch, commit record or patch digest disagrees is re-run (one more call, its usage never counted). - run of the released control plan: the control preflight's request is the released control-plan.json bytes, its evidence is ok with the released digest; effective limits are the tighter of current and stored, parallelism capped by the plan, node timeouts the stored ones. A changed candidate list, agent map or gate is refused before any call. With control plans off the plan still bounds the run (one legacy probe for the lead agent); with Toolgraph off, no call at all. - a released control-completed workflow reads as written through show, status, read_control_plan, conversations show and apply; its control-preflight.json is left as it is (no reader revalidates it). - recover classifies a released interrupted apply as completed, not applied or manual recovery, without touching the approval or the row. The doc row names these and drops "partly". Still not covered: the TUI's _read_artifact_result. 12 injected regressions each fail a test here, and part 2a's 24 still do. A thirteenth, skipping node_bundle_is_intact on reclaim, is equivalent at HEAD: read_node_result already verifies the bundle through the same read_node_bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1 found assertions that survived the code they protect: - every current limit used to be equal to or tighter than the released one, so taking the current value outright passed; the released-limits cases now run with wider current limits and assert the released ceilings, including with control plans or Toolgraph off; - reclaim checked the totals and the patch but not the final result rebuilt from the bundle; its output and its usage (TokenUsage.from_mapping) are now captured where the artifact is saved; - conversations show was checked on its manifest only; its result must equal the released result.json. 16 injected regressions now each fail a test here, and part 2a's 24 still do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2: the tighter-config case never lowered max_output_bytes, so ignoring the current output ceiling in favour of the stored one passed. It now runs with 64 KiB and asserts that value. 17 injected regressions now each fail a test here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #271. This is the Workflows family, part 2b: the three cases that part 2a (#289) left as "not yet", because each needs new release-written bytes. The issue stays open.
What
freeze.py --part 2badds scenarios to an existing release directory without writing anything already there. Each new scenario directory andbindings-2b.jsonmust not exist. It runs in a fresh box of its own; part 1's behaviour is unchanged. For both v0.2.0 and v0.3.0:bundle-saved: the worker exits right after the final node's bundle is saved, before the manifest records the node's outcome.bundle-saved-recovered: the same, after the release's ownstatus. In these two the fake kimi reports token usage (opt-in), so the bundle carries some.control-planned,control-completed: Toolgraph control plans on, with a faketoolgraphthat answers both protocols from the request it gets (preflight.pyis identical in both releases and HEAD).apply-unreceipted,apply-receipted: a completed workflow's final artifact applied in the release interpreter, dying right after theapplyingrecord or right before theappliedone. This is the artifacts family's crash script.calls_usedunchanged;control-plan.jsonbytes, and the evidence isokwith the released digest.show,status,read_control_plan,conversations show(manifest and result) andapply. Itscontrol-preflight.jsonis left as it is, because no reader revalidates it.recoverclassifies it as completed, not applied, or manual recovery, without touching the approval or the workflow row.docs/architecture/persisted-contracts.md: the Workflows row names these and drops "partly". Still not covered: the TUI's_read_artifact_result.No source under
src/changes. No current reader misread a released workflow.Verification
diff -ragainst a copy before generation, andgit statusshows only additions under the fixture tree).suite-runCLEAN;ruff check .clean.conversations showlosing its result.node_bundle_is_intacton reclaim, is equivalent at HEAD:read_node_resultalready verifies the bundle through the sameread_node_bundle..pop(), so v0.3.0's gate case silently passed; it was fixed before the first commit.381fbc1. Current limits were never wider than the released ones; the rebuilt final result and theconversations showresult were unchecked.3e3ed47. The tighter-config case never lowered the output ceiling.🤖 Generated with Claude Code